﻿using System;
using System.Collections.Generic;

namespace Me.Practice.ElevatorEngine.Domain.Entity
{
	[Serializable]
    public class Elevator
	{	
		public Elevator(Init init)
		{
			Id = init.Id;
			Capacity = init.Capacity;
			Timeout = init.Timeout;
			Persons = init.Persons;
			State = init.State;
			CurrentFloorNumber = init.CurrentFloorNumber;			
		}
		
		public string Id { get; private set; }
		public int Capacity { get; private set; }
		
		/// <summary>
		/// Gets elevator timeout in seconds.
		/// </summary>
		public int Timeout { get; private set; }
		public IEnumerable<Person> Persons { get; private set; }
		public ElevatorState State { get; internal set; }
		public int CurrentFloorNumber { get; internal set;}

		public class Init
		{
			public string Id { get; set; }
			public int Capacity { get; set; }
			
			/// <summary>
			/// Gets or sets elevator timeout in seconds.
			/// </summary>
			public int Timeout { get; set; }
			public IEnumerable<Person> Persons { get; set; } 
			public ElevatorState State { get; set; }
			public int CurrentFloorNumber { get; set; }
		}		
	}
}
